TARGET_NAME = ../core
TARGET_SUFFIX = dll
TARGET = $(TARGET_NAME).$(TARGET_SUFFIX)

LDFLAGS = -shared

RM = rm -rf


.PHONY: all clean


all: $(TARGET)

$(TARGET): $(patsubst %.c, %.o, $(wildcard *.c))
	$(CC) -o $@ $< -Wl,-dy,../cs.dll $(CFLAGS) $(CXXFLAGS) $(LDFLAGS)

%.o: %.c 
	$(CC) -c $< $(CFLAGS) $(CXXFLAGS) $(LDFLAGS)

clean:
	$(RM) $(TARGET)
	$(RM) *.o
